%% Author : lichuang 

-module(echubby_logger).
-export([debug_msg/4,
	 info_msg/4,
	 warning_msg/4,
	 error_msg/4,
	 critical_msg/4]).

-define(NEW_FORMAT(Module, Line, Format),
  "[" ++ Module ++ ":" ++ integer_to_list(Line) ++ "]:" ++ Format).

new_format(Module, Line, Format) ->
  "[" ++ Module ++ ":" ++ integer_to_list(Line) ++ "]" ++ Format ++ "~n".

debug_msg(Module, Line, Format, Args) ->
  NewFormat = new_format(Module, Line, Format),
  io:format(NewFormat, Args).

info_msg(Module, Line, Format, Args) ->
  NewFormat = new_format(Module, Line, Format),
  io:format(NewFormat, Args).

warning_msg(Module, Line, Format, Args) ->
  NewFormat = new_format(Module, Line, Format),
  io:format(NewFormat, Args).

error_msg(Module, Line, Format, Args) ->
  NewFormat = new_format(Module, Line, Format),
  io:format(NewFormat, Args).

critical_msg(Module, Line, Format, Args) ->
  NewFormat = new_format(Module, Line, Format),
  io:format(NewFormat, Args).
